Understanding data flow in BRX workflows
// User provides inputs directly to the BRK myBrk.input['user_query'] = 'How do I make a chocolate cake?'; myBrk.input['max_length'] = '500 words';
┌─────────────┐ │ Recipe BRK │ └─────┬───────┘ │ │ Output: Recipe details ▼ ┌─────────────┐ │ Format BRK │ └─────────────┘
┌─────────────┐ │ Config │ ──► API keys, settings, etc. └─────┬───────┘ │ ▼ ┌─────────────┐ │ API BRK │ └─────────────┘
┌─────────────┐ │ Router BRK │ └─────┬───────┘ │ ├─────► If condition A: BRK A │ ├─────► If condition B: BRK B │ └─────► If condition C: BRK C
const result = await brx.run(myBrk); console.log(result[0].brxRes.output);
┌─────────────┐ │ Extract BRK │ └─────┬───────┘ │ │ Output: Extracted data ▼ ┌─────────────┐ │ Analyze BRK │ └─────┬───────┘ │ │ Output: Analysis results ▼ ┌─────────────┐ │ Report BRK │ └─────────────┘
┌─────────────┐ │ Summary BRK │ └─────────────┘ ▲ │ ┌─────────────┼─────────────┐ │ Data BRK │ │ └─────────────┘ │ │ │ ▼ │ ┌─────────────┐ │ Chart BRK │ └─────────────┘
BRK A ──► BRK B ──► BRK C
BRK A ──┐ ├──► BRK C BRK B ──┘
// Conditional execution based on input if (input.format === 'markdown') { // Execute Markdown BRK const result = await brx.run(markdownBrk); } else { // Execute HTML BRK const result = await brx.run(htmlBrk); }
BRK A ──► BRK B ──► BRK C ──► BRK D
┌──► BRK B │ BRK A ───┼──► BRK C │ └──► BRK D
BRK A ──┐ │ BRK B ──┼──► BRK D │ BRK C ──┘
┌───────────────┐ │ │ │ ▼ BRK A ──► BRK B ──► BRK C
┌─────────────┐ │ Topic BRK │ ──► User provides a topic └─────┬───────┘ │ │ Output: Topic details ▼ ┌─────────────┐ │ Outline BRK │ ──► Generate an outline └─────┬───────┘ │ │ Output: Content outline ▼ ┌─────────────────────────────┐ │ Content Generation Router │ ──► Route based on content type └─────┬─────────┬─────────────┘ │ │ │ │ If video script │ ▼ │ ┌─────────────┐ │ │ Script BRK │ ──► Generate video script │ └─────────────┘ │ │ If blog post ▼ ┌─────────────┐ │ Blog BRK │ ──► Generate blog post └─────┬───────┘ │ │ Output: Blog content ▼ ┌─────────────┐ │ Edit BRK │ ──► Edit and refine content └─────┬───────┘ │ │ Output: Edited content ▼ ┌─────────────┐ │ Format BRK │ ──► Format for publication └─────────────┘